

package com.hazelcast.jet.impl.operation;

import com.hazelcast.jet.impl.JetServiceBackend;
import com.hazelcast.jet.impl.execution.init.JetInitDataSerializerHook;

import java.util.concurrent.CompletableFuture;

/**
 * Resumes the execution of a suspended job.
 */
public class ResumeJobOperation extends AsyncJobOperation {

    public ResumeJobOperation() {
    }

    public ResumeJobOperation(long jobId) {
        super(jobId);
    }

    @Override
    public CompletableFuture<Void> doRun() {
        JetServiceBackend service = getJetServiceBackend();
        return service.getJobCoordinationService().resumeJob(jobId());
    }

    @Override
    public int getClassId() {
        return JetInitDataSerializerHook.RESUME_JOB_OP;
    }
}
